<!DOCTYPE html>
<html>
  <head>
    <title>欢迎进入群空间</title>
  </head>
  <body>
    <div>
      {% with messages = get_flashed_messages(with_categories=True) %}
      <ul>
        {% for category, message in messages %}
        <li>{{ category }}: {{ message }}</li>
        {% endfor %}
      </ul>
      {% endwith %}
    </div>
    <div>
      <h3>Session data</h3>
      <ul>
        {% for key, val in session.items() %}
          <li><span>{{ key }}: </span>{{ val }}</li>
        {% endfor %}
      </ul>
      <p><a href="{{ url_for('gzone.clear_session', next=request.path) }}">clear sessions</a></p>
    </div>
    <div>
      <h3>user info:</h3>
      <p>openid: <i>{{ current_user.openid }}</i></p>
      <p>nickname: <i>{{ current_user.nickname }}</i></p>
      <p>headimgurl: <i>{{ current_user.headimgurl }}</i></p>
    </div>
    <div>
      <h3>room info:</h3>
      <P>room_id: <i>{{ current_room.id }}</i></P>
      <p>enc_room_id: <i>{{ current_room.enc_room_id }}</i></p>
    </div>
    <div>
      <h3>admin info:</h3>
      {% if current_user.is_admin %}
        <p>I'm an admin</p>
        <p>admin scope: <i>{{ session.admin }}</i></p>
      {% else %}
        <span>I am not an admin</span>
      {% endif %}
    </div>
    <div>
      <form method="POST" action="{{ url_for('gzone.login') }}">
        <lable>管理员登录</lable>
        <input type="password" name="password" />
        <input type="submit" />
      </form>
    </div>
    <div>
      <span>&#x1f602</span>
    </div>
    <div>
      <h3>URL</h3>
      <ul>
        <li>
          <a href="{{ url_for('gzone.announcement') }}">获取通告列表</a>
        </li>
        <li>
          <a href="{{ url_for('gzone.announcement', sticky=1) }}">获取置顶通告</a>
        </li>
        <li>
          <a href="{{ url_for('gzone.notice', top='') }}">获取首页告</a>
        </li>
        <li>
          <a href="{{ url_for('gzone.notice') }}">获取公告列表</a>
        </li>
        <li>
          <a href="{{ url_for('gzone.moment') }}">获取群友圈列表</a>
        </li>
        <li>
          <a href="{{ url_for('gzone.contact') }}">获取群友圈列表</a>
        </li>
      </ul>
    </div>
  </body>
</html>